import random

a=[2,3]
print(id(a))
a.append(4)
print(id(a),a)
a=a+[5]
print(id(a),a)

a.insert(3,6)
print(id(a),a)
b=[1,2,3,4,5,6,7,8,9]
a.extend(b)
print(id(a),a)
a.pop()

print(id(a),a)
a.pop(6)
print(id(a),a)
a.remove(7)
print(id(a),a)
del a[5]
print(id(a),a)

c = ['a','b','c','dsd','dsd',20,'sdf','sdf']
print(c.index('dsd'))
print('a' in c)
print(c.count('a'))

xh=0
for tmp in c:
    print(f'c[{xh}]:{tmp}', end='\n')
    xh+=1

d=[1,2,3,4,5,6,7,8,9]
print(d)
d.sort(reverse=True)        #不生成新的列表
print(d)
d.sort()
print(d)
random.shuffle(d)
print(d)

e=sorted(d)     #生成新的列表
print(e)
print(id(e),id(d))


h=[
    ['wuzubei',20,'厦门'],
    ['jojo',29,'北京'],
    ['beei',26,'上海'],
   ]
for i in range(3):
    for j in range(3):
        print(h[i][j],end='\t')
    print('\n')










